<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="keywords" content="Java">
    <meta name="description" content="学习记录">
    <meta name="author" content="Carry灭霸">
    
    <title>
        
            编程疑惑 |
        
        Carry
    </title>
    
<link rel="stylesheet" href="/css/style.css">

    <link rel="shortcut icon" href="/images/logo.svg">
    <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/hexo-theme-keep@3.4.3/source/css/font-awesome.min.css">
    <script id="hexo-configurations">
    let KEEP = window.KEEP || {};
    KEEP.hexo_config = {"hostname":"example.com","root":"/","language":"zh-CN","path":"search.xml"};
    KEEP.theme_config = {"toc":{"enable":true,"number":false,"expand_all":true,"init_open":true},"style":{"primary_color":"#0066CC","avatar":"/images/avatar.svg","favicon":"/images/logo.svg","article_img_align":"center","left_side_width":"260px","content_max_width":"920px","hover":{"shadow":false,"scale":false},"first_screen":{"enable":true,"background_img":"/images/bg.svg","description":"Hello World!"},"scroll":{"progress_bar":{"enable":true},"percent":{"enable":true}}},"local_search":{"enable":true,"preload":true},"code_copy":{"enable":true,"style":"default"},"pjax":{"enable":false},"lazyload":{"enable":false},"version":"3.4.3"};
    KEEP.language_ago = {"second":"%s 秒前","minute":"%s 分钟前","hour":"%s 小时前","day":"%s 天前","week":"%s 周前","month":"%s 月前","year":"%s 年前"};
  </script>
<meta name="generator" content="Hexo 5.4.0"></head>


<body>
<div class="progress-bar-container">
    
        <span class="scroll-progress-bar"></span>
    

    
</div>


<main class="page-container">

    

    <div class="page-main-content">

        <div class="page-main-content-top">
            <header class="header-wrapper">

    <div class="header-content">
        <div class="left">
            
            <a class="logo-title" href="/">
                Carry
            </a>
        </div>

        <div class="right">
            <div class="pc">
                <ul class="menu-list">
                    
                        <li class="menu-item">
                            <a class=""
                               href="/"
                            >
                                首页
                            </a>
                        </li>
                    
                        <li class="menu-item">
                            <a class=""
                               href="/archives"
                            >
                                归档
                            </a>
                        </li>
                    
                        <li class="menu-item">
                            <a class=""
                               href="/categories"
                            >
                                分类
                            </a>
                        </li>
                    
                        <li class="menu-item">
                            <a class=""
                               href="/tags"
                            >
                                标签
                            </a>
                        </li>
                    
                    
                        <li class="menu-item search search-popup-trigger">
                            <i class="fas fa-search"></i>
                        </li>
                    
                </ul>
            </div>
            <div class="mobile">
                
                    <div class="icon-item search search-popup-trigger"><i class="fas fa-search"></i></div>
                
                <div class="icon-item menu-bar">
                    <div class="menu-bar-middle"></div>
                </div>
            </div>
        </div>
    </div>

    <div class="header-drawer">
        <ul class="drawer-menu-list">
            
                <li class="drawer-menu-item flex-center">
                    <a class=""
                       href="/">首页</a>
                </li>
            
                <li class="drawer-menu-item flex-center">
                    <a class=""
                       href="/archives">归档</a>
                </li>
            
                <li class="drawer-menu-item flex-center">
                    <a class=""
                       href="/categories">分类</a>
                </li>
            
                <li class="drawer-menu-item flex-center">
                    <a class=""
                       href="/tags">标签</a>
                </li>
            
        </ul>
    </div>

    <div class="window-mask"></div>

</header>


        </div>

        <div class="page-main-content-middle">

            <div class="main-content">

                
                    <div class="fade-in-down-animation">
    <div class="article-content-container">

        <div class="article-title">
            <span class="title-hover-animation">编程疑惑</span>
        </div>

        
            <div class="article-header">
                <div class="avatar">
                    <img src="/images/avatar.svg">
                </div>
                <div class="info">
                    <div class="author">
                        <span class="name">Carry灭霸</span>
                        
                            <span class="author-label">Lv4</span>
                        
                    </div>
                    <div class="meta-info">
                        <div class="article-meta-info">
    <span class="article-date article-meta-item">
        <i class="fas fa-edit"></i>&nbsp;2021-10-09 00:00:00
    </span>
    
        <span class="article-categories article-meta-item">
            <i class="fas fa-folder"></i>&nbsp;
            <ul>
                
                    <li>
                        <a href="/categories/JAVA/">JAVA</a>&nbsp;
                    </li>
                
            </ul>
        </span>
    
    
        <span class="article-tags article-meta-item">
            <i class="fas fa-tags"></i>&nbsp;
            <ul>
                
                    <li>
                        <a href="/tags/mybatis/">mybatis</a>&nbsp;
                    </li>
                
                    <li>
                        | <a href="/tags/sql/">sql</a>&nbsp;
                    </li>
                
            </ul>
        </span>
    

    
    
    
    
        <span class="article-pv article-meta-item">
            <i class="fas fa-eye"></i>&nbsp;<span id="busuanzi_value_page_pv"></span>
        </span>
    
</div>

                    </div>
                </div>
            </div>
        

        <div class="article-content markdown-body">
            <h1 id="编程疑惑"><a href="#编程疑惑" class="headerlink" title="编程疑惑"></a>编程疑惑</h1><h2 id="1-mybatis中的-为什么能防止sql注入，-不能防止sql注入"><a href="#1-mybatis中的-为什么能防止sql注入，-不能防止sql注入" class="headerlink" title="1.mybatis中的#{} 为什么能防止sql注入，${}不能防止sql注入"></a>1.mybatis中的#{} 为什么能防止sql注入，${}不能防止sql注入</h2><h3 id="1-1sql注入"><a href="#1-1sql注入" class="headerlink" title="1.1sql注入"></a>1.1sql注入</h3><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">--正常登录语句</span></span><br><span class="line"><span class="keyword">SELECT</span> <span class="operator">*</span> <span class="keyword">FROM</span> <span class="keyword">user</span> <span class="keyword">WHERE</span> userName <span class="operator">=</span> admin <span class="keyword">and</span> password <span class="operator">=</span> <span class="number">111</span></span><br><span class="line"></span><br><span class="line"><span class="comment">--sql注入  #在sql语句中是注释导致无论密码错对都可以登录成功</span></span><br><span class="line"><span class="keyword">SELECT</span> <span class="operator">*</span> <span class="keyword">FROM</span> <span class="keyword">user</span> <span class="keyword">WHERE</span> userName <span class="operator">=</span> admin <span class="keyword">or</span> <span class="number">1</span> <span class="operator">=</span> <span class="number">1</span> # <span class="keyword">and</span> password <span class="operator">=</span> <span class="number">111</span></span><br></pre></td></tr></table></figure>

<h3 id="1-2原因"><a href="#1-2原因" class="headerlink" title="1.2原因"></a>1.2原因</h3><p>#{}在mybatis中的底层是运用了PreparedStatement 预编译，传入的参数会以 ? 形式显示，因为sql的输入只有在sql编译的时候起作用，当sql预编译完后，传入的参数就仅仅是参数，不会参与sql语句的生成，而${}则没有使用预编译，传入的参数直接和sql进行拼接，由此会产生sql注入的漏洞</p>
<h2 id="2-mysql分组查询每组最新的一条数据"><a href="#2-mysql分组查询每组最新的一条数据" class="headerlink" title="2.mysql分组查询每组最新的一条数据"></a>2.mysql分组查询每组最新的一条数据</h2><p>mysql5.7以上版本sql_mode有</p>
<p>ONLY_FULL_GROUP_BY：对于GROUP BY聚合操作，如果在SELECT中的列，没有在GROUP BY中出现，那么这个SQL是不合法的，或者这个字段出现在聚合函数里面</p>
<p>group by：select 选取分组中的列+聚合函数 from 表名称 group by 分组的列</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br></pre></td><td class="code"><pre><span class="line">#创建表语句</span><br><span class="line"><span class="comment">-- test.sys_user definition</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">CREATE</span> <span class="keyword">TABLE</span> `sys_user` (</span><br><span class="line">  `id` <span class="type">bigint</span>(<span class="number">20</span>) <span class="keyword">NOT</span> <span class="keyword">NULL</span> AUTO_INCREMENT COMMENT <span class="string">&#x27;主键&#x27;</span>,</span><br><span class="line">  `user_code` <span class="type">varchar</span>(<span class="number">100</span>) <span class="keyword">DEFAULT</span> <span class="keyword">NULL</span>,</span><br><span class="line">  `user_name` <span class="type">varchar</span>(<span class="number">100</span>) <span class="keyword">DEFAULT</span> <span class="keyword">NULL</span> COMMENT <span class="string">&#x27;用户名称&#x27;</span>,</span><br><span class="line">  `address` <span class="type">varchar</span>(<span class="number">10</span>) <span class="keyword">DEFAULT</span> <span class="keyword">NULL</span> COMMENT <span class="string">&#x27;地址&#x27;</span>,</span><br><span class="line">  `create_time` <span class="type">timestamp</span> <span class="keyword">NOT</span> <span class="keyword">NULL</span> <span class="keyword">DEFAULT</span> <span class="built_in">CURRENT_TIMESTAMP</span> COMMENT <span class="string">&#x27;创建时间&#x27;</span>,</span><br><span class="line">  <span class="keyword">PRIMARY</span> KEY (`id`)</span><br><span class="line">) ENGINE<span class="operator">=</span>InnoDB AUTO_INCREMENT<span class="operator">=</span><span class="number">12</span> <span class="keyword">DEFAULT</span> CHARSET<span class="operator">=</span>utf8 COMMENT<span class="operator">=</span><span class="string">&#x27;用户表&#x27;</span>;</span><br><span class="line"></span><br><span class="line">#插入数据</span><br><span class="line"><span class="keyword">INSERT</span> <span class="keyword">INTO</span> test.sys_user</span><br><span class="line">(id, user_code, user_name, address, create_time)</span><br><span class="line"><span class="keyword">VALUES</span>(<span class="number">1</span>, <span class="string">&#x27;1&#x27;</span>, <span class="string">&#x27;张三1&#x27;</span>, <span class="string">&#x27;北京&#x27;</span>, <span class="string">&#x27;2019-09-10 11:22:23&#x27;</span>);</span><br><span class="line"><span class="keyword">INSERT</span> <span class="keyword">INTO</span> test.sys_user</span><br><span class="line">(id, user_code, user_name, address, create_time)</span><br><span class="line"><span class="keyword">VALUES</span>(<span class="number">2</span>, <span class="string">&#x27;1&#x27;</span>, <span class="string">&#x27;张三2&#x27;</span>, <span class="string">&#x27;北京&#x27;</span>, <span class="string">&#x27;2019-09-10 12:22:23&#x27;</span>);</span><br><span class="line"><span class="keyword">INSERT</span> <span class="keyword">INTO</span> test.sys_user</span><br><span class="line">(id, user_code, user_name, address, create_time)</span><br><span class="line"><span class="keyword">VALUES</span>(<span class="number">3</span>, <span class="string">&#x27;1&#x27;</span>, <span class="string">&#x27;张三3&#x27;</span>, <span class="string">&#x27;北京&#x27;</span>, <span class="string">&#x27;2019-09-05 12:22:23&#x27;</span>);</span><br><span class="line"><span class="keyword">INSERT</span> <span class="keyword">INTO</span> test.sys_user</span><br><span class="line">(id, user_code, user_name, address, create_time)</span><br><span class="line"><span class="keyword">VALUES</span>(<span class="number">4</span>, <span class="string">&#x27;1&#x27;</span>, <span class="string">&#x27;张三4&#x27;</span>, <span class="string">&#x27;北京&#x27;</span>, <span class="string">&#x27;2019-09-06 12:22:23&#x27;</span>);</span><br><span class="line"><span class="keyword">INSERT</span> <span class="keyword">INTO</span> test.sys_user</span><br><span class="line">(id, user_code, user_name, address, create_time)</span><br><span class="line"><span class="keyword">VALUES</span>(<span class="number">5</span>, <span class="string">&#x27;2&#x27;</span>, <span class="string">&#x27;李四1&#x27;</span>, <span class="string">&#x27;上海&#x27;</span>, <span class="string">&#x27;2019-09-06 12:22:23&#x27;</span>);</span><br><span class="line"><span class="keyword">INSERT</span> <span class="keyword">INTO</span> test.sys_user</span><br><span class="line">(id, user_code, user_name, address, create_time)</span><br><span class="line"><span class="keyword">VALUES</span>(<span class="number">6</span>, <span class="string">&#x27;2&#x27;</span>, <span class="string">&#x27;李四2&#x27;</span>, <span class="string">&#x27;上海&#x27;</span>, <span class="string">&#x27;2019-09-07 12:22:23&#x27;</span>);</span><br><span class="line"><span class="keyword">INSERT</span> <span class="keyword">INTO</span> test.sys_user</span><br><span class="line">(id, user_code, user_name, address, create_time)</span><br><span class="line"><span class="keyword">VALUES</span>(<span class="number">7</span>, <span class="string">&#x27;2&#x27;</span>, <span class="string">&#x27;李四3&#x27;</span>, <span class="string">&#x27;上海&#x27;</span>, <span class="string">&#x27;2019-09-11 12:22:23&#x27;</span>);</span><br><span class="line"><span class="keyword">INSERT</span> <span class="keyword">INTO</span> test.sys_user</span><br><span class="line">(id, user_code, user_name, address, create_time)</span><br><span class="line"><span class="keyword">VALUES</span>(<span class="number">8</span>, <span class="string">&#x27;2&#x27;</span>, <span class="string">&#x27;李四4&#x27;</span>, <span class="string">&#x27;上海&#x27;</span>, <span class="string">&#x27;2019-09-12 12:22:23&#x27;</span>);</span><br><span class="line"><span class="keyword">INSERT</span> <span class="keyword">INTO</span> test.sys_user</span><br><span class="line">(id, user_code, user_name, address, create_time)</span><br><span class="line"><span class="keyword">VALUES</span>(<span class="number">9</span>, <span class="string">&#x27;3&#x27;</span>, <span class="string">&#x27;王二1&#x27;</span>, <span class="string">&#x27;广州&#x27;</span>, <span class="string">&#x27;2019-09-03 12:22:23&#x27;</span>);</span><br><span class="line"><span class="keyword">INSERT</span> <span class="keyword">INTO</span> test.sys_user</span><br><span class="line">(id, user_code, user_name, address, create_time)</span><br><span class="line"><span class="keyword">VALUES</span>(<span class="number">10</span>, <span class="string">&#x27;3&#x27;</span>, <span class="string">&#x27;王二2&#x27;</span>, <span class="string">&#x27;广州&#x27;</span>, <span class="string">&#x27;2019-09-04 12:22:23&#x27;</span>);</span><br><span class="line"><span class="keyword">INSERT</span> <span class="keyword">INTO</span> test.sys_user</span><br><span class="line">(id, user_code, user_name, address, create_time)</span><br><span class="line"><span class="keyword">VALUES</span>(<span class="number">11</span>, <span class="string">&#x27;3&#x27;</span>, <span class="string">&#x27;王二3&#x27;</span>, <span class="string">&#x27;广州&#x27;</span>, <span class="string">&#x27;2019-09-05 12:22:23&#x27;</span>);</span><br><span class="line"></span><br><span class="line">#查询语句</span><br><span class="line"><span class="keyword">select</span></span><br><span class="line">	e.id ,</span><br><span class="line">	e.user_name,</span><br><span class="line">	e.address</span><br><span class="line"><span class="keyword">from</span></span><br><span class="line">	sys_user e,</span><br><span class="line">	(</span><br><span class="line">	<span class="keyword">select</span></span><br><span class="line">		user_code ,</span><br><span class="line">		<span class="built_in">max</span>(create_time) <span class="keyword">as</span> create_time</span><br><span class="line">	<span class="keyword">from</span></span><br><span class="line">		sys_user su</span><br><span class="line">	<span class="keyword">group</span> <span class="keyword">by</span></span><br><span class="line">		user_code,</span><br><span class="line">		address ) <span class="keyword">as</span> t</span><br><span class="line"><span class="keyword">where</span></span><br><span class="line">	e.user_code <span class="operator">=</span> t.user_code</span><br><span class="line">	<span class="keyword">and</span> e.create_time <span class="operator">=</span> t.create_time;</span><br></pre></td></tr></table></figure>

<p><img src="https://gitee.com/carrywl/image-hosting/raw/master/image-codeStudy/image-20211009123707911.png" alt="image-20211009123707911"></p>
<h2 id="3-mysql查询sql-mode"><a href="#3-mysql查询sql-mode" class="headerlink" title="3.mysql查询sql_mode"></a>3.mysql查询sql_mode</h2><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">select</span> @<span class="variable">@global</span>.sql_mode;</span><br></pre></td></tr></table></figure>

<h2 id="4-windows端口占用问题"><a href="#4-windows端口占用问题" class="headerlink" title="4.windows端口占用问题"></a>4.windows端口占用问题</h2><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#</span><span class="bash">找到占用的进程</span></span><br><span class="line">netstat -aon|findstr 10000</span><br><span class="line"></span><br><span class="line"><span class="meta">#</span><span class="bash">杀死进程</span></span><br><span class="line">taskkill /f /t /im 10932</span><br></pre></td></tr></table></figure>

<p><img src="https://gitee.com/carrywl/image-hosting/raw/master/image-codeStudy/image-20200914161622359.png" alt="image-20200914161622359"></p>
<blockquote>
<p>参考资料：</p>
<blockquote>
<ol>
<li><a class="link"   target="_blank" rel="noopener" href="https://blog.csdn.net/weixin_42400621/article/details/113134111%E3%80%90%E6%9C%80%E6%96%B0%E6%95%B0%E6%8D%AE%E6%9F%A5%E8%AF%A2%E3%80%91" >https://blog.csdn.net/weixin_42400621/article/details/113134111【最新数据查询】<i class="fas fa-external-link-alt"></i></a></li>
<li><a class="link"   target="_blank" rel="noopener" href="https://blog.csdn.net/ZYC88888/article/details/83002882%E3%80%90left" >https://blog.csdn.net/ZYC88888/article/details/83002882【left<i class="fas fa-external-link-alt"></i></a> join】</li>
</ol>
</blockquote>
</blockquote>

        </div>

        
            <div class="post-copyright-info">
                <div class="article-copyright-info-container">
    <ul>
        <li>本文标题：编程疑惑</li>
        <li>本文作者：Carry灭霸</li>
        <li>创建时间：2021-10-09 00:00:00</li>
        <li>
            本文链接：https://carrywl.gitee.io/2021/10/09/编程疑惑/
        </li>
        <li>
            版权声明：本博客所有文章除特别声明外，均采用 <a class="license" target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">BY-NC-SA</a> 许可协议。转载请注明出处！
        </li>
    </ul>
</div>

            </div>
        

        
            <div class="article-nav">
                
                    <div class="article-prev">
                        <a class="prev"
                           rel="prev"
                           href="/2021/10/18/%E8%BD%AF%E4%BB%B6%E8%AE%BE%E8%AE%A1%E5%B8%88/"
                        >
                            <span class="left arrow-icon flex-center">
                              <i class="fas fa-chevron-left"></i>
                            </span>
                            <span class="title flex-center">
                                <span class="post-nav-title-item">软件设计师</span>
                                <span class="post-nav-item">上一篇</span>
                            </span>
                        </a>
                    </div>
                
                
                    <div class="article-next">
                        <a class="next"
                           rel="next"
                           href="/2021/10/08/%E6%90%AD%E5%BB%BA%E4%B8%80%E4%B8%AA%E5%B1%9E%E4%BA%8E%E8%87%AA%E5%B7%B1%E7%9A%84Blog/"
                        >
                            <span class="title flex-center">
                                <span class="post-nav-title-item">搭建一个属于自己的Blog</span>
                                <span class="post-nav-item">下一篇</span>
                            </span>
                            <span class="right arrow-icon flex-center">
                              <i class="fas fa-chevron-right"></i>
                            </span>
                        </a>
                    </div>
                
            </div>
        

        
            <div class="comment-container">
                <div class="comments-container">
    <div id="comment-anchor"></div>
    <div class="comment-area-title">
        <i class="fas fa-comments">&nbsp;评论</i>
    </div>
    

        
            
    <div class="valine-container">
        <script 
                src="//cdn.jsdelivr.net/npm/valine@latest/dist/Valine.min.js"></script>
        <div id="vcomments"></div>
        <script >
            function loadValine() {
                new Valine({
                    el: '#vcomments',
                    appId: 'GWXViL9oMzuvk5GoEyorAF5a-gzGzoHsz',
                    appKey: 'tfCnOVhjkUjT90W8EGLYvf0v',
                    meta: ['nick', 'mail', 'link'],
                    avatar: 'wavatar',
                    enableQQ: true,
                    placeholder: '😜 尽情吐槽吧~',
                    lang: 'zh-CN'.toLowerCase()
                });

                function getAuthor(language) {
                    switch (language) {
                        case 'en':
                            return 'Author';
                        case 'zh-CN':
                            return '博主';
                        default:
                            return 'Master';
                    }
                }

                // Add "Author" identify
                const getValineDomTimer = setInterval(() => {
                    const vcards = document.querySelectorAll('#vcomments .vcards .vcard');
                    if (vcards.length > 0) {
                        let author = 'Carry灭霸';

                        if (author) {
                            for (let vcard of vcards) {
                                const vnick_dom = vcard.querySelector('.vhead .vnick');
                                const vnick = vnick_dom.innerHTML;
                                if (vnick === author) {
                                    vnick_dom.innerHTML = `${vnick} <span class="author">${getAuthor(KEEP.hexo_config.language)}</span>`
                                }
                            }
                        }
                        clearInterval(getValineDomTimer);
                    } else {
                        clearInterval(getValineDomTimer);
                    }
                }, 2000);
            }

            if ('false') {
                const loadValineTimeout = setTimeout(() => {
                    loadValine();
                    clearTimeout(loadValineTimeout);
                }, 1000);
            } else {
                window.addEventListener('DOMContentLoaded', loadValine);
            }
        </script>
    </div>



        
    
</div>

            </div>
        
    </div>
</div>


                
            </div>

        </div>

        <div class="page-main-content-bottom">
            <footer class="footer">
    <div class="info-container">
        <div class="copyright-info info-item">
            &copy;
            
              <span>2021</span>&nbsp;-&nbsp;
            
            2022&nbsp;<i class="fas fa-heart icon-animate"></i>&nbsp;<a href="/">Carry灭霸</a>
        </div>
        
            <script async  src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
            <div class="website-count info-item">
                
                
            </div>
        
        <div class="theme-info info-item">
            由 <a target="_blank" href="https://hexo.io">Hexo</a> 驱动&nbsp;|&nbsp;主题&nbsp;<a class="theme-version" target="_blank" href="https://github.com/XPoet/hexo-theme-keep">Keep v3.4.3</a>
        </div>
        
    </div>
</footer>

        </div>
    </div>

    
        <div class="post-tools">
            <div class="post-tools-container">
    <ul class="tools-list">
        <!-- TOC aside toggle -->
        
            <li class="tools-item page-aside-toggle">
                <i class="fas fa-outdent"></i>
            </li>
        

        <!-- go comment -->
        
            <li class="go-comment">
                <i class="fas fa-comment"></i>
            </li>
        
    </ul>
</div>

        </div>
    

    <div class="right-bottom-side-tools">
        <div class="side-tools-container">
    <ul class="side-tools-list">
        <li class="tools-item tool-font-adjust-plus flex-center">
            <i class="fas fa-search-plus"></i>
        </li>

        <li class="tools-item tool-font-adjust-minus flex-center">
            <i class="fas fa-search-minus"></i>
        </li>

        <li class="tools-item tool-expand-width flex-center">
            <i class="fas fa-arrows-alt-h"></i>
        </li>

        <li class="tools-item tool-dark-light-toggle flex-center">
            <i class="fas fa-moon"></i>
        </li>

        <!-- rss -->
        

        

        <li class="tools-item tool-scroll-to-bottom flex-center">
            <i class="fas fa-arrow-down"></i>
        </li>
    </ul>

    <ul class="exposed-tools-list">
        <li class="tools-item tool-toggle-show flex-center">
            <i class="fas fa-cog fa-spin"></i>
        </li>
        
            <li class="tools-item tool-scroll-to-top flex-center">
                <i class="arrow-up fas fa-arrow-up"></i>
                <span class="percent"></span>
            </li>
        
    </ul>
</div>

    </div>

    
        <aside class="page-aside">
            <div class="post-toc-wrap">
    <div class="post-toc">
        <ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E7%BC%96%E7%A8%8B%E7%96%91%E6%83%91"><span class="nav-text">编程疑惑</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-mybatis%E4%B8%AD%E7%9A%84-%E4%B8%BA%E4%BB%80%E4%B9%88%E8%83%BD%E9%98%B2%E6%AD%A2sql%E6%B3%A8%E5%85%A5%EF%BC%8C-%E4%B8%8D%E8%83%BD%E9%98%B2%E6%AD%A2sql%E6%B3%A8%E5%85%A5"><span class="nav-text">1.mybatis中的#{} 为什么能防止sql注入，${}不能防止sql注入</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-1sql%E6%B3%A8%E5%85%A5"><span class="nav-text">1.1sql注入</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-2%E5%8E%9F%E5%9B%A0"><span class="nav-text">1.2原因</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-mysql%E5%88%86%E7%BB%84%E6%9F%A5%E8%AF%A2%E6%AF%8F%E7%BB%84%E6%9C%80%E6%96%B0%E7%9A%84%E4%B8%80%E6%9D%A1%E6%95%B0%E6%8D%AE"><span class="nav-text">2.mysql分组查询每组最新的一条数据</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-mysql%E6%9F%A5%E8%AF%A2sql-mode"><span class="nav-text">3.mysql查询sql_mode</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-windows%E7%AB%AF%E5%8F%A3%E5%8D%A0%E7%94%A8%E9%97%AE%E9%A2%98"><span class="nav-text">4.windows端口占用问题</span></a></li></ol></li></ol>
    </div>
</div>
        </aside>
    

    <div class="image-viewer-container">
    <img src="">
</div>


    
        <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
          <span class="search-input-field-pre">
            <i class="fas fa-keyboard"></i>
          </span>
            <div class="search-input-container">
                <input autocomplete="off"
                       autocorrect="off"
                       autocapitalize="off"
                       placeholder="搜索..."
                       spellcheck="false"
                       type="search"
                       class="search-input"
                >
            </div>
            <span class="popup-btn-close">
                <i class="fas fa-times"></i>
            </span>
        </div>
        <div id="search-result">
            <div id="no-result">
                <i class="fas fa-spinner fa-pulse fa-5x fa-fw"></i>
            </div>
        </div>
    </div>
</div>

    

</main>



<script src="//cdn.jsdelivr.net/npm/hexo-theme-keep@3.4.3/source/js/utils.js"></script><script src="//cdn.jsdelivr.net/npm/hexo-theme-keep@3.4.3/source/js/main.js"></script><script src="//cdn.jsdelivr.net/npm/hexo-theme-keep@3.4.3/source/js/header-shrink.js"></script><script src="//cdn.jsdelivr.net/npm/hexo-theme-keep@3.4.3/source/js/back2top.js"></script><script src="//cdn.jsdelivr.net/npm/hexo-theme-keep@3.4.3/source/js/dark-light-toggle.js"></script>


    <script src="//cdn.jsdelivr.net/npm/hexo-theme-keep@3.4.3/source/js/local-search.js"></script>



    <script src="//cdn.jsdelivr.net/npm/hexo-theme-keep@3.4.3/source/js/code-copy.js"></script>




<div class="post-scripts">
    
        <script src="//cdn.jsdelivr.net/npm/hexo-theme-keep@3.4.3/source/js/left-side-toggle.js"></script><script src="//cdn.jsdelivr.net/npm/hexo-theme-keep@3.4.3/source/js/libs/anime.min.js"></script><script src="//cdn.jsdelivr.net/npm/hexo-theme-keep@3.4.3/source/js/toc.js"></script>
    
</div>



</body>
</html>
